﻿using MiniExcelLibs;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.Core.SeedData
{
    public class MemorySeedData<T> : ISqlSugarSeed<T> where T : class, new()
    {
        public virtual int Execute(SqlSugarScope db)
        {
            var data = Read();
            var count = 0;
            if (data.Count > 0)
                count = db.Insertable(data).ExecuteCommand();
            return count;
        }

        public virtual List<T> Read()
        {
            return [];
        }
    }
}
